<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>模块信息实例列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
// 是否需要重新刷新页面
var g_needReloadPage = false;
</script>
</head>
<body>
<div>
	<span class="page_titile">模块信息实例列表</span> 
</div>

<form method="get" action="list.do" >
<table class="input_table" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="input_titile_td">模块名</td>
		<td class="input_content_td">
			<input type="text" name="moduleId" value="<c:out value='${moduleId}' />" />
		</td>
		<td class="input_content_td" align="center">
			<input type="submit" value=" 搜索 " />
		</td>
	</tr>
</table>
</form>

<form:form method="get" action="list.do" name="frmTurnPage1">
	<input type="hidden" name="moduleId" value="<c:out value='${moduleId}' />" />
	<!-- 隐含变量 -->
	<jsp:include page="/WEB-INF/jsp/common/turnPage.jsp">
		<jsp:param name="formName" value="frmTurnPage1" />
	</jsp:include>
</form:form>

<form action="delRecords.do" 
	onsubmit="return Util.confirmSelectedCheckboxes(this, 'checkAll', '请选择要删除的 记录信息', '确认要删除这些 记录信息吗?');" >
<div>
	&nbsp;&nbsp;
	<input type="submit" value=" 删除 " />
	<a href="javascript: g_needReloadPage = true; Util.popupIframeCenter('popupDiv', 600, 400, 'popupTitle', '新增模块信息', 'popupIframe', 'showAdd.do');">新增</a>
</div>

<table class="records_table" align="center" cellspacing="0" cellpadding="0">
	<tr class="records_table_head" >
		<td>
			<input type="checkbox" id="checkAll" 
				onclick="if (this.checked) Util.selectAllCheckbox(this.form); else Util.cancelAllCheckbox(this.form); " /> 
		</td>
		<td>模块名</td>
		<td>IP</td>
		<td>PORT</td>
		<td>状态</td>
		<td>创建时间</td>
		<td>更新时间</td>
		<td>操作</td>
	</tr>
<c:forEach items="${pageData.resultList}" var="record">
	<tr class="records_table_record" >
		<td>
			<input type="checkbox" name="delIds" value="<c:out value='${record.instanceId}' />"  
				onclick="Util.verifyCheckAll(this.form, 'checkAll');" /> 
		</td>
		<td><c:out value="${record.moduleId}" /></td>
		<td><c:out value="${record.ip}" /></td>
		<td><c:out value="${record.port}" /></td>
		<td><c:out value="${record.status}" /></td>
		<td><fmt:formatDate value="${record.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
		<td><fmt:formatDate value="${record.updateTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
		<td>
			<a href="javascript: g_needReloadPage = false; Util.popupIframeCenter('popupDiv', 600, 400, 'popupTitle', '模块信息', 'popupIframe', 'show.do?id=<c:out value="${record.instanceId}" />');" >查看</a>
			| <a href="javascript: g_needReloadPage = true; Util.popupIframeCenter('popupDiv', 600, 400, 'popupTitle', '修改模块信息', 'popupIframe', 'showUpd.do?id=<c:out value="${record.instanceId}" />');" >修改</a>
		</td>
	</tr>
</c:forEach>
</table>

</form>

<form:form method="get" action="list.do" name="frmTurnPage2">
	<input type="hidden" name="moduleId" value="<c:out value='${moduleId}' />" />
	<!-- 隐含变量 -->
	<jsp:include page="/WEB-INF/jsp/common/turnPage.jsp">
		<jsp:param name="formName" value="frmTurnPage2" />
	</jsp:include>
</form:form>

<div id='popupDiv' style="position:absolute;z-index:9999;width:300px;height:250;display:none;" class="popup_style" >
	<div class="close" onclick="javascript: $('#popupDiv').hide(); if (g_needReloadPage) location.reload();"></div>
    <div class="title"><h2 id="popupTitle"></h2></div>
    <div class="content"><iframe id="popupIframe" src="" frameborder="0" scrolling="auto" width="100%" height="100%"></iframe>
    </div>
</div>

</body>
</html>